# !/usr/bin/env python3
# -*- coding: utf-8 -*-

from flask.ext.restful import Resource
from app import db
from .models import User

__author__ = 'InG_byr'


class HelloWorld(Resource):
    """
    Just for api services test
    """

    def get(self):
        return {'hello': 'world'}


class GetUser(Resource):
    """
    Get the <user_id> information
    """

    def get(self, user_id):
        user = User.query.filter_by(username=user_id).first()
        if user is not None:
            return {'user_id': user.username,
                    'db_id': user.id}
        else:
            return {}
